package com.gzist.elderlyserviceplatform.config;

import com.gzist.elderlyserviceplatform.service.RedisService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * redis缓存初始化
 */
@Component
public class RedisCacheRunner implements ApplicationRunner {

    private final RedisService redisService;

    public RedisCacheRunner(RedisService redisService) {
        this.redisService = redisService;
    }

    @Override
    public void run(ApplicationArguments args) {
        redisService.initRedisCache();
    }
}